package com.mapfinal.mapcache.utils;

import com.lambkit.core.gateway.Gateway;
import com.lambkit.core.gateway.GatewayConfig;

public class HttpKit {

	public static Gateway keepAlive() {
		GatewayConfig config = new GatewayConfig();
		config.setLog(true);
		//1分钟过期
		config.setConnectTimeout(60000);
		config.setReadTimeout(60000);
		config.setKeepAlive(true);
		return new Gateway(config);
	}
	
	public static Gateway use() {
		return new Gateway();
	}
	
	public static Gateway use(int timeout) {
		GatewayConfig config = new GatewayConfig();
		config.setLog(true);
		//1分钟过期
		config.setConnectTimeout(timeout);
		config.setReadTimeout(timeout);
		return new Gateway(config);
	}
}
